﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Runda.CMS.Common.Utility;
using Runda.CMS.Common.Entity;
using Runda.CMS.Bll;

namespace Runda.CMS.Portal.WorkFlow
{
    public partial class WfDefined : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack) {
                BindList(1);
            }
        }

        private void BindList(int pageindex)
        {
            List<SqlDbParameter> parms = new List<SqlDbParameter>();
            int RecordCount = 0;
            List<WflModelEntity> list = new CtrtBillBll().GetAll<WflModelEntity>(parms, "CreatedOn desc", AspNetPager1.PageSize, pageindex, out RecordCount);

            RepeaterFlows.DataSource = list;
            RepeaterFlows.DataBind();
            AspNetPager1.RecordCount = RecordCount;
        }
        protected void AspNetPager1_PageChanged(object sender, EventArgs e)
        {
            BindList(AspNetPager1.CurrentPageIndex);
        }

        protected void RepeaterFlows_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            if (e.CommandName == "refersh")
            {
                BindList(1);
            }
        }
    }
}
